-- 插件管理


local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)


local plugin_specs = {
  --所有插件都安装在这里

  --主题插件
  {
    "folke/tokyonight.nvim",
    lazy = false,
    priority = 1000,
  },

  -- 让Neovim背景变透明，如果你需要透明的UI或者模糊背景的效果，就需要用上这个插件
  {"xiyaowong/nvim-transparent"},

  -- 一个超快(Blazingly Fast!)的状态栏美化插件
  {
    "nvim-lualine/lualine.nvim",
    dependencies = { "nvim-tree/nvim-web-devicons" },
  },

  --buffer管理插件  
  {
    "akinsho/bufferline.nvim",
    version = "*",
    dependencies = { "nvim-tree/nvim-web-devicons", "moll/vim-bbye" },
  },

  -- 文件管理器
  {
    "nvim-tree/nvim-tree.lua",
    version = "*",
    dependencies = {
      "nvim-tree/nvim-web-devicons",
    },
  },

  -- 代码块缩进显示插件
  {
    "lukas-reineke/indent-blankline.nvim",
    config = function()
      require("ibl").setup {}
    end,
  },

  -- 平滑滚动插件
  { "karb94/neoscroll.nvim" },

  -- 显示git里增加，删除，编辑地方
  { "lewis6991/gitsigns.nvim",
    config = function()
      require("gitsigns").setup()
    end,
  },

  -- 一个超快的显示hex颜色的插件
  {
    "norcalli/nvim-colorizer.lua",
    config = function()
      require("colorizer").setup()
    end,
  },

  -- 代码语法高亮，支持多种语言
  { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },

  -- 在文件顶部显示目前函数名
  { 'nvim-treesitter/nvim-treesitter-context' },

  -- 光标位于一个词语时，页面上其他同一个词语加下划线
  { 'RRethy/vim-illuminate' },

  -- format
  { "nvimtools/none-ls.nvim", dependencies = "nvim-lua/plenary.nvim" },

  -- dashboard
  { "nvimdev/dashboard-nvim", 
    event = "VimEnter", 
    dependencies = { { "nvim-tree/nvim-web-devicons" } } 
  },

  -- 自动补全
  { "windwp/nvim-autopairs" },


  --彩虹括号
  {"HiPhish/rainbow-delimiters.nvim"},


  --注释插件
  {
    "numToStr/Comment.nvim",
    version = "*",
  },
  --搜索
  {'nvim-telescope/telescope.nvim', dependencies = "nvim-lua/plenary.nvim"},
  {"LinArcX/telescope-env.nvim"},

  --项目管理
  {"ahmedkhalf/project.nvim"},

  --lsp
  --{"neovim/nvim-lspconfig"},
  --{"williamboman/mason.nvim"},
  --{"williamboman/mason-lspconfig.nvim"}

}

local lazy_opts = {
  defaults = {
    lazy = true,
    version = "*"
  },
  ui = {
    border = "rounded",
    title = "Plugin Manager",
    title_pos = "center",
  },
}

require("lazy").setup(plugin_specs, lazy_opts)

